//
//  StatusTipsView.m
//  CedarFinancePH
//
//  Created by menchao on 2018/4/2.
//  Copyright © 2018年 cedarhd. All rights reserved.
//

#import "StatusTipsView.h"

@interface StatusTipsView()


@property (nonatomic,strong) NSString *tipsTitle;
@property (nonatomic,strong) NSString *tipsText;


@property (nonatomic,strong) UILabel *titleLabel;
@property (nonatomic,strong) UILabel *textLabel;

@end

@implementation StatusTipsView

- (instancetype)initWithTipsTitle:(NSString *)tips text:(NSString *)text{
    if (self = [super init]) {
        self.tipsTitle = tips;
        self.tipsText = text;
        self.backgroundColor = [UIColor greenColor];
        [self initUI];
    }
    return self;
}

- (void)initUI{
    UILabel *titleLabel = [[UILabel alloc]init];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.text = self.tipsTitle;
    titleLabel.textColor = kGrayTextColor;
    self.titleLabel = titleLabel;
    [self addSubview:titleLabel];

    UILabel *textLabel = [[UILabel alloc]init];
    textLabel.textAlignment = NSTextAlignmentCenter;
    textLabel.text = self.tipsText;
    textLabel.numberOfLines = 0;
    textLabel.textColor = kGrayTextColor;
    [self addSubview:textLabel];
    self.textLabel = textLabel;
}


- (void)updateLayoutConstraints{
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).mas_offset(20);
        make.centerX.mas_equalTo(self);
    }];
    [self.textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(20);
        make.right.mas_offset(-20);
        make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(20);
    }];
}


@end
